<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class AddFeildCompanyFurniture extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('company_furniture', function (Blueprint $table) {
            if (!Schema::hasColumn('company_furniture', 'label_id')) {
                $table->unsignedBigInteger('label_id')->nullable()->comment('标签id');
            }
            if (!Schema::hasColumn('company_furniture', 'is_top')) {
                $table->boolean('is_top')->default(false)->comment('顶级');
            }
        });

        Schema::table('company_furniture_task', function (Blueprint $table) {

            if (!Schema::hasColumn('company_furniture_task', 'label_id')) {
                $table->unsignedBigInteger('label_id')->nullable()->comment('标签id');
            }
            if (!Schema::hasColumn('company_furniture_task', 'is_top')) {
                $table->boolean('is_top')->default(false)->comment('顶级');
            }
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
